#!/bin/bash


if [ -z "$1" ];then
    echo "[E] need baseimage"
    exit 1
fi
base_image="$1"


name2="pytorch_notebook"
if [ -n "$2" ];then
    name2="$2"
fi

tag="global"
if [ -n "$3" ];then
    tag="$3"
fi

if [ ! -e "fileroot.$tag" ];then
    echo "[E] fileroot.$tag : not eixts"
    exit 1
fi


test -e fileroot && rm -r fileroot
cp -r fileroot.$tag fileroot

docker build -f "Dockerfile" -t "$name2" --build-arg IMAGE=$base_image .

